package com.longbo.demostudy.demo.smsVerification;

import org.springframework.expression.Operation;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class IndustrySMS {
    private  static String operation = "/industrySMS/sendSMS";
    private static  String accountSid = VerifyConfig.ACCCOUNT_SID;
    private static String to = "15108397831";
    private static String smsCoutent = "【龙秦科技】登录验证码：{"+VerifyConfig.runNumber().toString()+"}，如非本人操作，请忽略此短信。";

    public static void execute(){
        String tmpSmsContent = null;

        try {
            tmpSmsContent = URLEncoder.encode(smsCoutent,"UTF-8");
        } catch (Exception e) {

        }
        String url = VerifyConfig.BASE_URL + operation;
        String body =  "accountSid=" + accountSid + "&to=" + to + "&smsContent=" + tmpSmsContent
                + HttpUtil.createCommonParam();
        // 提交请求
        String result = HttpUtil.post(url, body);
        System.out.println("result:" + System.lineSeparator() + result);
    }
}
